<template>
    <view>
        <template v-for="(item, index) in AVEncVideoColorList">
            <j-cell-group :key="index" :title="'通道' + index">
                <template v-for="(pro, size) in item">
                    <j-cell-card :key="pro.size" :title="'颜色配置' + size" :show="false" :is-touch="false" border style="background: #f5f7fb">
                        <j-cell title="是否可配置" :more="false">
                            <view slot="tips">
                                <switch :checked="pro.Enable" disabled></switch>
                            </view>
                        </j-cell>
                        <j-cell title="对应的时间段" :tips="pro.TimeSection" :more="false"></j-cell>
                        <j-cell-card title="图像颜色配置参数" :show="false" :is-touch="false" border style="background: #f5f7fb">
                            <j-cell title="明锐度" :tips="pro.VideoColorParam.Acutance" :more="false"></j-cell>
                            <j-cell title="亮度" :tips="pro.VideoColorParam.Brightness" :more="false"></j-cell>
                            <j-cell title="对比度" :tips="pro.VideoColorParam.Contrast" :more="false"></j-cell>
                            <j-cell title="增益" :tips="pro.VideoColorParam.Gain" :more="false"></j-cell>
                            <j-cell title="色度" :tips="pro.VideoColorParam.Hue" :more="false"></j-cell>
                            <j-cell title="饱和度" :tips="pro.VideoColorParam.Saturation" :more="false"></j-cell>
                            <j-cell title="白平衡" :tips="pro.VideoColorParam.Whitebalance" :more="false"></j-cell>
                        </j-cell-card>
                    </j-cell-card>
                </template>
            </j-cell-group>
        </template>
    </view>
</template>

<script>
export default {
    data() {
        return {
            token: '',
            AVEncVideoColorList: [],

            pro: {
                size: '',
                Enable: '',
                TimeSection: '',

                VideoColorParam: {
                    Acutance: '',
                    Brightness: '',
                    Contrast: '',
                    Gain: '',
                    Hue: '',
                    Saturation: '',
                    Whitebalance: ''
                }
            },

            size: ''
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        console.log(options);
			this.token = options.token
			this.getconfig();
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        getconfig() {
            uni.showLoading();
            let token = this.token;
            let data = {
                Name: 'AVEnc.VideoColor'
            };
            getApp().globalData.api.getconfig(data, token, (result) => {
                uni.hideLoading({
                    success: (res) => {
                        console.log(result);
                        this.AVEncVideoColorList = result['AVEnc.VideoColor']
                    }
                });
            });
        }
    }
};
</script>
<style></style>
